<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #btn1{
            position: fixed;
            right: 0px;
            bottom: 0px;
        }
        #btn2{
            position: fixed;
            right: 0px;
            bottom: 50px;
        }
    </style>
</head>
<body>


    <button id="btn1" onclick="test1()">测试1</button>
    <button id="btn2" onclick="autoscrool()">自动往下滚动</button>




    <script type="text/javascript">
        var position=0;
        function test1()
        {
            position+=100;
            scrollTo(0,position);
                            
            // setTimeout 在10ms之后执行 test1
            // setTimeout(test1,10);
        }
        


        function autoscrool(){
            position+=1;
            scrollTo(0,position);
            setTimeout(autoscrool,10);
        }
    </script>

<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>asdf
<br>
<br>
<br>
<br>asd
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>123
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
123
<br>
<br>
<br>
<br>
<br>
<br>
<br>

</body>
</html>